
minetest.register_craftitem("areahelper_key:areakey", {
    description = "Objeto de administración de areahelper",
    -- inventory_image = minetest.inventorycube(imgyellow, imgyellow, imgyellow    ),
    inventory_image = "areahelper_key.png",
    groups = {areahelper = 1, tool = 1},
    stackable = true,
    on_use = function (itemstack, user, pointed_thing)
        --[[local inv = user:get_inventory(); -- inventario del usuario.
        
        
        
        -- LLAMAR AL FORMSPEC.amount
        -- TODO - HACER CHECK DE PERMISOS Y QUE NO SALGA EL FORMULARIO.
        local habilitado, miss = minetest.check_player_privs(user, areas.adminPrivs);
        if (not habilitado) then
            minetest.chat_send_player(user:get_player_name(), "No tiene suficiente permiso para utilizar el item");
            return itemstack;
        end

        local cabecera = "Marcar extensión del area";
        local form = {
            areahelper.dimensionformspec,
            "label[0.375,0.50;", minetest.formspec_escape(cabecera), "]",
            "field[0.375,1.25;2 ,0.8;ancho;Ancho;]",
            "field[0.375,2.50.25;2,0.8;largo;Largo;]",
            "field[0.375,3.75;2,0.8;alto;Alto;]",

            "field[6    ,1.25;2,0.8;soterrado;Soterrado;]",
            "field[6    ,2.50;4,0.8;descriptor;Tag;]",
            "field[6    ,3.75;2,0.8;amount;Cantidad;]",
            "button_exit[4.5,5;3,0.8;setear;Setear]"
        };

        local salida = minetest.show_formspec(user:get_player_name(), "areahelper:plannerform", table.concat(form, ""));
        
        -- RECIBIR LOS DATOS DEL FORMSPEC Y ALMACENARLOS EN EL OBJETO DE SALIDA DEBE OCUURIR EN EL CALLBACK.
        ]]--
        return itemstack;
    end,
    --[[tool_capabilities = {
        full_punch_interval = 1.5,
        max_drop_level = 1,
        groupcaps = {
        },
        damage_groups = {},
    },
    ]]--
    
});